package com.matpala.practico1.b;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.xy.XYBarRenderer;
import org.jfree.data.statistics.SimpleHistogramBin;
import org.jfree.data.statistics.SimpleHistogramDataset;


public class HistogramaNuevo {
	public static void main(String[] args){
		
		SimpleHistogramDataset data = new SimpleHistogramDataset("Histograma");
		data.addBin(new SimpleHistogramBin(0, 1,true,false));
		data.addBin(new SimpleHistogramBin(1, 2,true,false));
		data.addBin(new SimpleHistogramBin(2, 3,true,false));
		data.addBin(new SimpleHistogramBin(3, 4,true,false));
		data.addBin(new SimpleHistogramBin(4, 5,true,false));
		data.addBin(new SimpleHistogramBin(5, 6,true,false));
		data.addBin(new SimpleHistogramBin(6, 7,true,false));
		data.addBin(new SimpleHistogramBin(7, 8,true,false));
		data.addBin(new SimpleHistogramBin(8, 9,true,false));
		data.addBin(new SimpleHistogramBin(9,10 ,true,true));
		data.addObservations(new double[]{0,1,1,1,1,2,2,3,4,5,6,6,6,7,7,7,7,7,7,7,8,8,9,9,9,9,9,9,10,10,10});
		
		JFreeChart chart = ChartFactory.createHistogram("nuevo", "frecuencia", "cantidad",
				data, PlotOrientation.VERTICAL, true, true, false);
		ChartFrame frame = new ChartFrame("Hola", chart);
		frame.pack();
		frame.setVisible(true);
	}
	

}
